package com.tube.fiddles.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.tube.fiddles.dao.MenuDao;
import com.tube.fiddles.domain.Menu;
import com.tube.fiddles.service.MenuService;

@Service("menuService")
public class MenuServiceImpl implements MenuService {
    
    @Autowired
    private MenuDao menuDao;

    @Override
    public void save(Menu menu) {
        menuDao.save(menu);
    }

    @Override
    public Menu findById(String menuId) {
        return menuDao.find(Menu.class, menuId);
    }

    @Override
    public int findNameLike(Menu menu) {
        return menuDao.count(menu);
    }

}
